import Vue from 'vue'
Vue.directive('clientHeight', {
    bind(el, binding) {
        let h = function () {
            let height = document.documentElement.clientHeight
            el.style.height = height + binding.value.height + 'px'
            el.style.background = "url(" + binding.value.imgUrl + ") no-repeat "
            el.style.backgroundSize = "cover"
        }
        h()
        window.onresize = h
    }
})

Vue.directive('hidden', {
    bind(el, binding) {
        let w = function () {
            let w = document.documentElement.clientWidth;
            if (w < binding.value) {
                el.style.display = 'none'
            }else{
                el.style.display = 'inline'
            }
        }
        window.onresize = w
    }
})